Hệ thống quản lý phương tiện trong PHP

1 <?php
2     session_start();
3      $connection= mysqli_connect(
'localhost','root','','vehiclemanagement');
4
5     $select_query=
"SELECT * FROM `booking` ORDER BY booking_id DESC";
6     $result= mysqli_query($connection,$select_query);
7     
8
9     
10 ?>
11
12
13 <!DOCTYPE html>
14 <html lang=
"en">
15 <head>
16     <meta charset=
"UTF-8">
17     <title>Booking list</title>
18     <link href=
"http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
19     <script src=
"http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
20     <link rel=
"stylesheet" href="http://cdn.datatables.net/1.10.2/css/jquery.dataTables.min.css">
21     <link rel=
"stylesheet" href="sweetalert2/sweetalert2.css">
22     <script src=
"sweetalert2/sweetalert2.min.js"></script>
23     <script type=
"text/javascript" src="http://cdn.datatables.net/1.10.2/js/jquery.dataTables.min.js"></script>
24     <script type=
"text/javascript" src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
25     <link rel=
"stylesheet" href="animate.css">
26     <link rel=
"stylesheet" href="style.css">
27 </head>
28
29 <body>
30   <?php include
'navbar_admin.php'; ?>
31   <br><br>
32    <div
class="container">
33         <div
class="row">
34            <div
class="col-md-12">
35              <div
class="page-header">
36                 <h1 style=
"text-align: center;">Booking List</h1>
37                  
38               </div>
39               <table id=
"myTable" class="table table-bordered animated bounce">
40                 <thead>
41                     
42                     <th>Booking Id</th>
43                     <th>Name</th>
44                     <th>Type</th>
45                     
46                     <th>Delete</th>
47                     <th>Release</th>
48                     <th>Confirm Trip</th>
49                     <th>Checked</th>
50                     <th>Finished</th>
51                     <th>Bill</th>
52                     <th>Confirm Payment</th>
53                     <th>Paid</th>
54                     
55                 </thead>
56                 
57                 <tbody>
58                     <?php
while($row=mysqli_fetch_assoc($result)){ ?>
59                     <tr>
60                        
61                         <td><?php echo $row[
'booking_id']; ?></td>
62                         <td><?php echo $row[
'name']; ?></td>
63                         <td><?php echo $row[
'type']; ?></td>
64                        
65                         
66                         <td><a
class="btn btn-danger" href="deletebooking.php?id=<?php echo $row['booking_id']; ?>">Delete</a></td>
67                         
68                         <?php
if($row['confirmation']==0 or $row['finished']==1) { ?>
69                         <td><a
class="btn btn-default disabled" href="releasebooking.php?id=<?php echo $row['booking_id']; ?>">Release Vehicle</a></td>
70                         <?php }
else{ ?>
71                         <td><a
class="btn btn-default" href="releasebooking.php?id=<?php echo $row['booking_id']; ?>">Release Vehicle</a></td>
72                         <?php } ?>
73                         
74                         <?php
if($row['confirmation']=='0'){ ?>
75                         <td><a
class="btn btn-success" href="confirmbooking.php?id=<?php echo $row['booking_id']; ?>">Confirm</a></td>
76                         <?php }
else { ?>
77                         <td><a
class="btn btn-success disabled" href="confirmbooking.php?id=<?php echo $row['booking_id']; ?>">Confirm</a></td>
78                         <?php } ?>
79                         
80                         <?php
if($row['confirmation']=='0'){ ?>
81                         <td>No</td>
82                         <?php }
else { ?>
83                         <td>Yes</td>
84                         <?php } ?>
85                         
86                         <?php
if($row['finished']=='0'){ ?>
87                         <td>No</td>
88                         <?php }
else { ?>
89                         <td>Yes</td>
90                         <?php } ?>
91                         
92                         
93                         
94                         <?php
if($row['finished']=='1' and $row['paid']==0 ){ ?>
95                         <td><a
class="btn btn-primary" href="bill.php?id=<?php echo $row['booking_id']; ?>">Bill</a></td>
96                          <?php }
else if($row['paid']==1 ) { ?>
97                           <td><a
class="btn btn-primary disabled" href="bill.php?id=<?php echo $row['booking_id']; ?>">Bill</a></td>
98                           <?php } ?>
99                           
100                          
101                           <td><a href=
"confirmpayment.php?id=<?php echo $row['booking_id']; ?>">Confirm</a></td>
102                           
103                           <?php
if($row['paid']=='0'){ ?>
104                         <td>No</td>
105                         <?php }
else { ?>
106                         <td>Yes</td>
107                         <?php } ?>
108                           
109                           
110                           
111                         
112                     </tr>
113                     
114
115                     <?php } ?>
116                 </tbody>
117             </table>
118             </div>
119         </div>
120         
121         
122    </div>
123 </body>
124
125 <script>
126 $(document).ready(function(){
127     $(
'#myTable').dataTable();
128 });
129 </script>
130 </html>


Gõ tìm kiếm nhanh...